﻿@{
    Layout = null;
}

<script src="@SiteUrl.GetStaticResourceScriptUrl(" ~/js/wdtree/tree.js")"></script>
<link href="@SiteUrl.GetStaticResourceScriptUrl(" ~/js/wdtree/tree.css")" rel="stylesheet" />
<div class="topPanel">
    <div class="search">
        <table>
            <tr>
                <td class="formValue">
                    <input id="txt_keyword" type="text" class="form-control" onblur="yssx()" placeholder="元素名称" style="width:100px;height:17px;">
                </td>
            </tr>
        </table>
    </div>
</div>
<div id="dv_Medlist" class="gridPanel">
    <table id="gridListYs"></table>
</div>
<script type="text/javascript">
    $(function () {
        gridListYs();
    })
    function yssx() {
        $("#gridListYs").jqGrid('setGridParam', {
            postData: { keyword: $("#txt_keyword").val() },
        }).trigger('reloadGrid');
    }

    function gridListYs() {
        var $gridList = $("#gridListYs");
        $gridList.dataGrid({
            treeGrid: true,
            treeGridModel: "adjacency",
            ExpandColumn: "Readonly",
            url: "/SystemManage/Common/GetYsTreeList",
            postData: { keyword: $("#txt_keyword").val() },
            height: $(window).height() - 150,
            colModel: [
                { label: "Id", name: "Id", key: true, hidden: true },
                { label: "Name", name: "BindingPath", hidden: true },
                { label: "DataSource", name: "DataSource", hidden: true },
                { label: "BindingPath", name: "BindingPath", hidden: true },
                { label: "TypeName", name: "TypeName", hidden: true },
                { label: "yslx", name: "yslx", hidden: true },
                { label: "元素控件",width:210, name: "ysmc" },
            ],
            onSelectRow: function (rowid, status) {
                if (status == true) {
                    var rowData = $("#gridListYs").jqGrid('getRowData', rowid);
                    $("#tijiao").html("修改");
                    GetFormJson(rowData.Id);    
                }
            }


        });
    }






    //function SetHeight() {
    //    //debugger;
    //    var ctl = document.getElementById("YsTree");
    //    if (ctl != null) {
    //        if (ctl.getAttribute("ismobiledevice") != "true") {
    //            // 对于移动设备不设置控件高度
    //            //var s1 = document.documentElement.currentStyle;
    //            //var s2 = document.body.currentStyle ;
    //            var h = document.documentElement.clientHeight - ctl.offsetTop - 20;
    //            ctl.style.height = h + "px";
    //        }
    //        else {
    //            if (document.body.clientWidth < 400) {
    //                document.getElementById("cboFileName").style.width = "100%";
    //            }
    //        }
    //    }
    //}
    //window.setTimeout(SetHeight, 300);
    //window.setInterval(SetHeight, 1000);
    //function getYsTree() {
    //    $("#YsTree").treeview({
    //        height: 400,
    //        slimscroll: false,
    //        showcheck: true,
    //        url: "/MedicalRecordManage/Blys/GetYsTree",
    //        //param: { aa: "" },
    //        onnodeclick: function (item) {
    //            if (item.value != 'parent') {
    //                $("#tijiao").html("修改");
    //                GetFormJson(item.id);
    //            }
    //        },
    //        onnodedbclick: function (item) {
    //            if (item.value != 'parent') {

    //            }
    //        }
    //    });

    //}

</script>
